# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=meowdict
pkgver=0.10.5
pkgrel=0
pkgdesc="CLI web client for moedict.tw"
url="https://github.com/eatradish/meowdict"
arch="all"
license="MIT"
depends="opencc"
makedepends="
	cargo
	cargo-auditable
	opencc-dev
	openssl-dev
	"
source="https://github.com/eatradish/meowdict/archive/v$pkgver/meowdict-$pkgver.tar.gz
	getrandom-0.2.14.patch
	nix-0.28.0.patch
	update-test_wordshk_api_result.patch
	"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dvm755 target/release/meowdict -t "$pkgdir"/usr/bin/

	install -Dvm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
2af8e39e6fa6c3dc54a38993f59bef4b893255b9dc05c47af6bd3fd2f61654f8768b748c33f9f623a255e73e0d06f9301d15390cfeee09466015daaaab457698  meowdict-0.10.5.tar.gz
d1eadfb6b000be2a020b5430793a81bd880ec0be4de2604aa96fa74757e16c9dff22c0c46b87ef417f33d03c22ec3d1a784f20c71ec0d31a58fafafe9194408e  getrandom-0.2.14.patch
a4ecda37f88cc2ea6bcf799ec76246ad9b7fa680c4c92431494bd371859386a3b26b95e10ddda85702796f050212e4e2124380948813b8539fea19c701ab4fc8  nix-0.28.0.patch
8ba5e8e9be32009a55813cb9d891374bbcc8267fd06bd727f228b03e4d3da754d7ecf7b3b412b8b9a0601437bc980021867d7432caa33011220f3cd0849643d3  update-test_wordshk_api_result.patch
"
